<template>
	<view class="agreementTextAre borderR">
		<uni-icons class="close" :type="'closeempty'" :color="blackColor" size="20" @click="cancel"/>
		<scroll-view class="contetAre" scroll-y="true">
			<rich-text :nodes="content"></rich-text>
		</scroll-view>
	</view>
</template>

<script>
	import util from '@/common/util.js'
	export default {
		props:['type'],
		data() {
			return {
				list: {},
				content: '',
				blackColor: this.global.blackColor
			};
		},
		methods:{
			getData(){
				let type = ''
				if(this.list){
					switch (this.list.text){
						case `${this.global.companyName}商城用户服务协议及隐私政策`:
							type = 6
							break;
						case `${this.global.companyName}商城店名及店铺信息发布规则`:
							type = 2
							break;
						case `${this.global.companyName}商城平台服务、结算服务协议`:
							type = 4
							break;
						case `${this.global.companyName}商城供应商管理规范`:
							type = 3
							break;
						case `${this.global.companyName}商城保证金保障服务协议`:
							type = 1
							break;
					}
				}
				util.getAjax(this.global.apiUrl + '/get_xy_one',(res)=>{
					console.log(res);
					this.content = res.data.content
				},{id: type})
			},
			cancel(){
				this.$emit('cancel','agreement')
			}
		}
	}
</script>

<style lang="scss">
	.agreementTextAre{
		@include width(690rpx);
		@include backG;
		position: relative;
		.close{
			position: absolute;
			top: 10rpx;
			right: 10rpx;
			z-index: 99;
		}
		.contetAre{
			height: 1000rpx;
			@include padding(30rpx);
		}
	}
</style>
